package java03;

import java.util.*;
class PersonOverride{
	private String name;
	private boolean gender;
	private int age;
	public PersonOverride() {
		this("default",1,true);
	}
	public PersonOverride(String name,int age, boolean gender) {
		this.name = name;
		this.age = age;
		this.gender = gender;
	}
	public String toString() {
		return  name + "-" + age + "-" + gender;
	}
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		PersonOverride other = (PersonOverride) obj;
		if (age != other.age)
			return false;
		if (gender != other.gender)
			return false;
		if (name == null) {
			if (other.name != null)
				return false;
		} else if (!name.equals(other.name))
			return false;
		return true;
	}
	
}
public class Java35 {

	public static void main(String[] args) {
		
		Scanner in = new Scanner(System.in);
		int n1 = Integer.parseInt(in.nextLine());
		ArrayList<PersonOverride> persons1  = new ArrayList<PersonOverride>();
		for (int i = 0; i < n1; i++) {
			persons1.add(new PersonOverride());
		}
		ArrayList<PersonOverride> persons2  = new ArrayList<PersonOverride>();
		int n2 = Integer.parseInt(in.nextLine());
		for (int j = 0; j < n2; j++) {
			PersonOverride a = new PersonOverride(in.next(),in.nextInt(),in.nextBoolean());
			if(!persons2.contains(a)) persons2.add(a);
  	    }
		for (int i = 0; i < n1; i++) {
			System.out.println(persons1.get(i));
		}
		for (int k = 0; k < persons2.size() ; k++) {
			System.out.println(persons2.get(k).toString());
		}
		System.out.println(persons2.size());
		System.out.println(Arrays.toString(PersonOverride.class.getConstructors()));
	}
}